package com.glsc.ngateway.common.api.flowable.dto.task.formData.equipment.domainDto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.glsc.ngateway.common.api.flowable.dto.AppendixDto;
import com.glsc.ngateway.common.api.flowable.dto.task.FlowFormBaseEntityDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.util.List;


/**
 * @author xuchang
 */
@EqualsAndHashCode(callSuper = true)
@SuperBuilder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class FlowFormEquipmentApplyDto extends FlowFormBaseEntityDto {

    private static final long serialVersionUID = 2601663776328571958L;

    @ApiModelProperty(value = "希望使用日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate flowDesiredDate;

    @ApiModelProperty(value = "预计使用时限类型")
    private String usageTimeType;

    @ApiModelProperty(value = "预计使用截止日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateSerializer.class)
    @JsonDeserialize(using = LocalDateDeserializer.class)
    private LocalDate useDeadline;

    @ApiModelProperty(value = "无固定期限理由")
    private String noFixedTermReason;

    @ApiModelProperty(value = "其他")
    private String others;

    @ApiModelProperty(value = "附件")
    private List<AppendixDto> appendicesFileList;

}
